package com.hp.it.portal.servlet;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hp.it.portal.handler.SonarReportConfigurationHandler;

public class SonarReportConfigurationServlet extends HttpServlet
{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
	{
		doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
	{
		String urlStr = req.getRequestURI();
		String action = urlStr.substring(urlStr.lastIndexOf("/") + 1);
		SonarReportConfigurationHandler handler = new SonarReportConfigurationHandler();
		handler.handle(action, req);
		try
		{
			resp.sendRedirect("/QualityPortal/query.jsp?KEE=" + req.getParameter("KEE"));
		} catch (IOException e)
		{
			e.printStackTrace();
		}
	}
}
